Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor BaseActiveRecord::getAttributes() #279

Merged
merged 6 commits into from
Dec 29, 2023
Merged

Conversation

Tigrov
Copy link
Member

@Tigrov Tigrov commented Dec 17, 2023

Improve performance

Q A
Is bugfix?
New feature?
Breaks BC?
Fixed issues -

Copy link

codecov bot commented Dec 17, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6d9864b) 87.70% compared to head (662479b) 87.70%.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #279   +/-   ##
=========================================
  Coverage     87.70%   87.70%           
  Complexity      595      595           
=========================================
  Files             7        7           
  Lines          1326     1326           
=========================================
  Hits           1163     1163           
  Misses          163      163           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

what-the-diff bot commented Dec 17, 2023

PR Summary

  • Enhancement in BaseActiveRecord.php
    The code in this file was updated to streamline the process of retrieving specific attributes of records. This was done through the use of array_diff, array_combine, and array_map functions, which provides more flexibility and efficiency in handling data.
  • Addition of a new test in ActiveQueryTest.php
    A test, testGetAttributesOnly, has been added that checks the functionality of fetching specified attributes only in getAttributes method. This allows us to ensure the enhancement made is functioning as expected.

@xepozz
Copy link
Member

xepozz commented Dec 21, 2023

Improve performance

Could you prove the result with benchmarks?

@Tigrov
Copy link
Member Author

Tigrov commented Dec 29, 2023

Could you prove the result with benchmarks?

Simplified PR, left only the obvious part

@Tigrov Tigrov merged commit eb86518 into master Dec 29, 2023
53 checks passed
@Tigrov Tigrov deleted the refactor-getAttributes branch December 29, 2023 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants